#include "StdAfx.h"
#include "NwChannelInfoCache.h"
#include "NwDataCache.h"
using namespace NS_GXX;
namespace NS_NW_DAL
{


CNwChannelInfoCache::CNwChannelInfoCache(CNwDataCache* pDataCache)
{
	//CString strSourcePath = pDataCache->m_pNdaxAdapter->GetFilePath();
	//m_strPathName = strSourcePath +L"~.temp";
	//CFileRW fR,fW ;
	//ASSERT( fR.OpenFile( strSourcePath.GetBuffer(),OPEN_EXISTING,TRUE) == TRUE );
	//ASSERT( fW.OpenFile( m_strPathName.GetBuffer(),CREATE_ALWAYS) == TRUE );
	//DWORD dwStartPos,dwLen;
	//pDataCache->GetChannelInfoPos(dwStartPos,dwLen);
	//BYTE *buf = new BYTE[dwLen];
	//fR.SeekBegin();
	//ASSERT( fR.Read(buf,dwLen) == dwLen );
	//fW.Write(buf,dwLen);
	//fW.Flush();
	//m_pINdaAdapter = new CNdaDataAdapterFile;
	//m_pINdaAdapter->Open( m_strPathName.GetBuffer() );
	//delete []buf;
}

CNwChannelInfoCache::~CNwChannelInfoCache(void)
{
	if( m_pINdaAdapter )
	{
		IFileNda * pNda = m_pINdaAdapter->GetFileNdaInterface();
		delete pNda;
		delete m_pINdaAdapter;
	}
}


}
